package com.time.sky.controller;

import com.time.sky.entity.SM;
import com.time.sky.mapper.SMMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/SM")
public class SMController {
    @Autowired
    private SMMapper smMapper;
    @ResponseBody
    @RequestMapping("/select")
    public List<SM> selectList(){
        return smMapper.selectList(); }
    @RequestMapping("/add")
    public void add(SM sm){
        smMapper.add(sm);
    }
    @RequestMapping("/delete/{sid}")
    public void delete(@PathVariable("sid") int sid){
        smMapper.delete(sid);
    }
    @RequestMapping("/get/{bid}")
    public SM getById(@PathVariable("sid") int sid){
        return smMapper.getById(sid);
    }
    @RequestMapping("/update")
    public void update(SM sm){
        smMapper.update(sm);
    }
}
